home *** CD-ROM | disk | FTP | other *** search
/ Skunkware 5 / Skunkware 5.iso / src / Tools / man2html-2.0.2 / examples / security.txt / text0000.txt < prev   
Encoding:
Text File  |  1995-06-19  |  882 b   |  36 lines

  1.  
  2.  Earl,
  3.  
  4.  first of all, I want to thank you a lot for this wonderful package. It's
  5. really a great job. So great that immediately after trying man2html, I managed
  6. to install related CGI scripts in my HTTP server; this is where the story
  7. starts.
  8.  
  9.  I'd like to focus your attention about serious security problems if those
  10. scripts. In fact, some filehandles are opened to a pipe which arguments come
  11. directly from user's query.
  12.  
  13.  For example, in "manpage", we have:
  14.  
  15.     $mancommand   = "man $manflags $topic";
  16.  
  17.  and later:
  18.  
  19.     open (MAN, "$mancommand 2> /dev/null |")
  20.  
  21.  Now, if the user submits:
  22.  
  23.     ls ; rm -rf /
  24.  
  25.  as a topic, the whole command "man ls ; rm -rf /" is executed :-(
  26.  
  27.  As suggested in the "camel book", I replaced those commands with something as:
  28.  
  29.     open (MAN,"-|") || exec 'man',$manflags,$topic;
  30.  
  31.  which is more secure.
  32.  
  33.  Excuse me if I wasted your time. Cheers,
  34.  
  35.     -JCT-
  36.